package com.study;

import java.util.Scanner;

/**
 * 键盘对象 Scanner
 * 1.导包 import java.util.Scanner; //idea自动导包的，不需要写
 * 2.创建对象 Scanner sc = new Scanner(System.in);
 * 3.调用方法，接收数据 int num = sc.nextInt();
 */
public class ScannerDemo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int num = sc.nextInt();
        System.out.println("你输入的数字是：" + num);
    }
}
